﻿using UnityEngine;
using System.Collections;

public class Health : MonoBehaviour {
	public float _totalHealth = 5f;
	public float _moneyWorth = 1f;
	public float _curHealth;
	public GameObject _greenBar;

	// Use this for initialization
	void Start () {
		this._curHealth = this._totalHealth;
	}
	
	// Update is called once per frame
	void Update () {
		if (this._curHealth <= 0)
		{
			GameObject.Find ("StatTracker").GetComponent<StatTracker>().AddMoney(this._moneyWorth);
			Destroy (this.gameObject);
		}
	}
}
